/**
 * 存储
 * 
 * @param {Object} key
 * @param {Object} obj
 */
function save(key, obj) {
	uni.setStorageSync(key, JSON.stringify(obj))
}

/**
 * 取值
 * 
 * @param {Object} key
 */
function get(key) {
	try {
		const str = uni.getStorageSync(key)
		return JSON.parse(str)
	} catch(err) {
		return null
	}
}

const StorageUtil = {
	save,
	get
}

export default StorageUtil